package com.cdhkppm.constant;

import com.hustcad.plm.pdm.core.handle.exception.ErrorCodeEnum;
import com.hustcad.plm.pdm.core.handle.exception.MessageException;
import lombok.Getter;

import java.util.Locale;


@Getter
public enum HKErrorCodeEnum implements ErrorCodeEnum{

    PROJECT_TYPE_NOT_EXIST(100020,"typlm.test.error.code.msg","","INFO"),
    EXPORT_TYPE_NOT_EXIST(100021,"typlm.test.error.code.msg","","INFO"),
    USER_NOT_EXIST(100023, "typlm.test.error.code.msg","","INFO"),
    GROUP_NOT_EXIST(100024, "typlm.test.error.code.msg","","INFO"),
    IMPORTTASK_TYPE_NOT_EXIST(100022,"typlm.test.error.code.msg","","INFO");


    private int code;
    private String msg;
    private String enMsg;
    private String type;

    private HKErrorCodeEnum(int code, String msg, String enMsg, String type) {
        this.code = code;
        this.msg = msg;
        this.enMsg = enMsg;
        this.type = type;
    }


    public int getCode() {
        return this.code;
    }

    public HKErrorCodeEnum setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return this.msg;
    }

    public HKErrorCodeEnum setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public String getEnMsg() {
        return this.enMsg;
    }

    public HKErrorCodeEnum setEnMsg(String enMsg) {
        this.enMsg = enMsg;
        return this;
    }

    public String getType() {
        return this.type;
    }

    public HKErrorCodeEnum setType(String type) {
        this.type = type;
        return this;
    }

    public MessageException build() {
        return new MessageException(this);
    }

    public MessageException message(Object... args) {
        return args != null && args.length != 0 ? new MessageException(this, Locale.SIMPLIFIED_CHINESE, args) : new MessageException(this, Locale.SIMPLIFIED_CHINESE);
    }
}
